<template>
  <section>
    <div>
      <el-input size="mini" v-model="widget.config.val" type="textarea"></el-input>
    </div>
  </section>
</template>

<script>
  import $ from "jquery"
  import Vue from 'vue'//后续添加属性，需要vue联动
  export default {
    name: "score-grade",
    props:['widget','mockData'],
    data(){
      return{
        targetList:[
          {name:'湿气',code:'shiqi'},
          {name:'木郁',code:'muyu'},
        ]
      }
    },
    watch:{
      widget(nv,ov){
        console.log('————————————',nv)
      }
    },
    created(){
      this.init()
    },
    methods:{
      init(){
        if(!this.widget.data) Vue.set(this.widget,'data',{target:[]})

      },
      testEvent(ctrl){
        var ctrl=document.getElementById('test')
        var CaretPos = 0;
        if (document.selection) { // IE Support
          ctrl.focus();
          var Sel = document.selection.createRange()
          Sel.moveStart('character', -ctrl.value.length);
          CaretPos = Sel.text.length;
        }else if(ctrl.selectionStart || ctrl.selectionStart == '0'){// Firefox support
          CaretPos = ctrl.selectionStart;
        }
        ctrl.value = ctrl.value.substr(0, CaretPos) + '插入内容啊啊啊啊' + ctrl.value.substring(CaretPos, ctrl.value.length)
        return (CaretPos);
      },
      addEvent(){

      },
      stopstop(e){
        console.log('阻止冒泡---------',e)
        // e.stopPropagation()
      }
    }
  }
</script>

<style scoped>

</style>
